public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        System.out.println("总节点个数:");
        binaryTree.size1(root);//调用查找节点总数方法
        //没有返回值，因为是静态变量所以可以通过类名进行调用变量进行打印
        System.out.println(BinaryTree.nodeSize);
        System.out.println(binaryTree.size2(root));
        System.out.println("叶子节点个数：");
        binaryTree.getLeafNodeCount1(root);
        System.out.println(binaryTree.leafSize);
        System.out.println(binaryTree.getLeafNodeCount2(root));
        System.out.println("第K层节点个数:");
        System.out.println(binaryTree.getKLevelNodeCount(root,3));
        System.out.println("树的高度：");
        System.out.println(binaryTree.getHeight(root));
        System.out.println("查找value节点：");
        /*BinaryTree.TreeNode ret = binaryTree.find(root, 's');
        System.out.println(ret.val);*/
        System.out.println(binaryTree.find(root,'G').val);
    }
    public static void main1(String[] args) {
        BinaryTree binaryTree = new BinaryTree();
        BinaryTree.TreeNode root = binaryTree.createTree();
        //System.out.println(root);
        binaryTree.perOrder(root);
        System.out.println();
        binaryTree.inOrder(root);
        System.out.println();
        binaryTree.postOrder(root);
    }
}
